<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../templates/ui.xhtml">

    <ui:define name="content">

        <h1 class="title ui-widget-header ui-corner-all">DataExporter - Exclude Columns</h1>
        <div class="entry">
            <p>Particular columns can be excluded in exported document.</p>    	

            <h:form id="form">
                <p:dataTable id="tbl" var="car" value="#{tableBean.cars}" 
                             paginator="true" rows="10">
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Model" />
                        </f:facet>
                        <h:outputText value="#{car.model}" />
                    </p:column>

                    <p:column exportable="false">
                        <f:facet name="header">
                            <h:outputText value="Year" />
                        </f:facet>
                        <h:outputText value="#{car.year}" />
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Manufacturer" />
                        </f:facet>
                        <h:outputText value="#{car.manufacturer}" />
                    </p:column>

                    <p:column exportable="false">
                        <f:facet name="header">
                            <h:outputText value="Color" />
                        </f:facet>
                        <h:outputText value="#{car.color}" />
                    </p:column>
                </p:dataTable>

                <h:commandLink id="excel">
                    <p:graphicImage value="/images/excel.png" />
                    <p:dataExporter type="xls" target="tbl" fileName="cars" />
                </h:commandLink>

                <h:commandLink id="pdf">
                    <p:graphicImage value="/images/pdf.png" />
                    <p:dataExporter type="pdf" target="tbl" fileName="cars" />
                </h:commandLink>

                <h:commandLink id="csv">
                    <p:graphicImage value="/images/csv.png" />
                    <p:dataExporter type="csv" target="tbl" fileName="cars" />
                </h:commandLink>

                <h:commandLink id="xml">
                    <p:graphicImage value="/images/xml.png" />
                    <p:dataExporter type="xml" target="tbl" fileName="cars" />
                </h:commandLink>
            </h:form>

            <h3>Source</h3>
            <p:tabView>
                <p:tab title="exporterExclude.xhtml">
                    <pre name="code" class="xml">
&lt;p:dataTable id="tbl" var="car" value="\#{tableBean.cars}" paginator="true" rows="10"&gt;
	&lt;p:column&gt;
		&lt;f:facet name="header"&gt;
			&lt;h:outputText value="Model" /&gt;
		&lt;/f:facet&gt;
		&lt;h:outputText value="\#{car.model}" /&gt;
	&lt;/p:column&gt;

	&lt;p:column exportable="false"&gt;
		&lt;f:facet name="header"&gt;
			&lt;h:outputText value="Year" /&gt;
		&lt;/f:facet&gt;
		&lt;h:outputText value="\#{car.year}" /&gt;
	&lt;/p:column&gt;

	&lt;p:column&gt;
		&lt;f:facet name="header"&gt;
			&lt;h:outputText value="Manufacturer" /&gt;
		&lt;/f:facet&gt;
		&lt;h:outputText value="\#{car.manufacturer}" /&gt;
	&lt;/p:column&gt;

	&lt;p:column  exportable="false"&gt;
		&lt;f:facet name="header"&gt;
			&lt;h:outputText value="Color" /&gt;
		&lt;/f:facet&gt;
		&lt;h:outputText value="\#{car.color}" /&gt;
	&lt;/p:column&gt;
&lt;/p:dataTable&gt;
	
&lt;h:commandLink&gt;
	&lt;p:graphicImage value="/images/excel.png" /&gt;
	&lt;p:dataExporter type="xls" target="tbl" fileName="cars" /&gt;
&lt;/h:commandLink&gt;

&lt;h:commandLink&gt;
	&lt;p:graphicImage value="/images/pdf.png" /&gt;
	&lt;p:dataExporter type="pdf" target="tbl" fileName="cars" /&gt;
&lt;/h:commandLink&gt;

&lt;h:commandLink&gt;
	&lt;p:graphicImage value="/images/csv.png" /&gt;
	&lt;p:dataExporter type="csv" target="tbl" fileName="cars" /&gt;
&lt;/h:commandLink&gt;

&lt;h:commandLink&gt;
	&lt;p:graphicImage value="/images/xml.png" /&gt;
	&lt;p:dataExporter type="xml" target="tbl" fileName="cars" /&gt;
&lt;/h:commandLink&gt;
                    </pre>
                </p:tab>
            </p:tabView>
        </div>

    </ui:define>
</ui:composition>
